doc4 {

    data = "/home/doc4/data/"
    
    queue {
        indexdir = "/home/doc4/mirror/mandriva/rsync/"
        logfile = "/home/doc4/logs/QueueMaker.log"    
        queries {
            createqueue = "insert into PACKAGE_QUEUE (package,distribution,architecture_folder,architecture,branch,section, action,state,add_date) select distinct(S.package), distribution, architecture_folder, architecture, branch, section, ?, ?,date from SNAPSHOT_DISTRIBUTION_PACKAGES S where not exists (select P.package from PACKAGES P where P.package=S.package);"
            
            rsyncexclude = "select distinct(package) as pkg,architecture_folder,branch,section,distribution from SNAPSHOT_DISTRIBUTION_PACKAGES SDP where distribution=? and not exists (select package from PACKAGE_QUEUE PQ where PQ.package=SDP.package and action='download' and state='queued') order by architecture_folder,branch,section,package"
                    
            loadsnapshot = "load data infile ? into table SNAPSHOT_DISTRIBUTION_PACKAGES fields terminated by ',' enclosed by '\"' lines terminated by '\n';"
        }
    }
    
    database {
        name = "jdbc:mysql://localhost:3306/doc4"
        driver = "com.mysql.jdbc.Driver"
        user = "xwiki"
        password = "xwiki"

    }
    

    extraction {
        outputdir = "/home/doc4/data"
        logfile = "/home/doc4/logs/Extraction.log"
        mirror = "/home/doc4/mirror/mandriva/"
        scriptdir = "/home/doc4/package-extractor/"
        skipifextracted = false
        queries {
            count =  "select count(distinct(package)) as ct, architecture, branch, section from  PACKAGE_QUEUE where state='queued' and action='extraction' group by architecture, branch, section order by architecture,branch,section"
            queue = "select distinct(package) as pkg, distribution, architecture_folder, architecture, branch, section, state, action from PACKAGE_QUEUE PQ where state='queued' and action='extraction' order by package"
            
        }
    }

    rsync {
        logfile = "/home/doc4/logs/Rsync.log"
        rsync_script_home = "/home/doc4/mirror/mandriva/rsync"
        queries {
            
          setfinished=  "update PACKAGE_QUEUE set state='finished' where action='download' and distribution=? and add_date=(select distinct(date) from SNAPSHOT_DISTRIBUTION_PACKAGES where distribution=?)"
        }
    }
    

    distributions {
        list = ["cooker","2009.1"]
    }

    
    loader {
        logfile = "/home/doc4/logs/Loader.log"
        queries {
            loadpackages = "load data infile ? into table PACKAGES fields terminated by ',' enclosed by '\"' lines terminated by '\n';"
            loadfiles = "load data infile ? into table PACKAGE_FILES fields terminated by ',' enclosed by '\"' lines terminated by '\n';"
            loaddependencies = "load data infile ? into table PACKAGE_DEPENDENCIES fields terminated by ',' enclosed by '\"' lines terminated by '\n';"
            makeold =  "update DISTRIBUTION_PACKAGES set islatest=0"
            makelatest =  "insert into DISTRIBUTION_PACKAGES (pid, distribution, date, islatest) (select distinct(P.id), distribution, date,1 from SNAPSHOT_DISTRIBUTION_PACKAGES SDP, PACKAGES P where P.package=SDP.package)"
            cleansnapshot = "delete from SNAPSHOT_DISTRIBUTION_PACKAGES"
        }
    }
    
    xmltocsv {
        csvdir = "/home/doc4/logs/"
        logfile = "/home/doc4/logs/XmlToCsv.log"
        
        queries {
            getmaxid = "select max(id) as max from PACKAGES"
            getqueue = "select distinct(package) as pkg from PACKAGE_QUEUE as PQ1 where state='queued' and action='tocsv' order by package"
            setrunning = "UPDATE PACKAGE_QUEUE set state='running', start_date=? where package=? and action='tocsv'"
            setfinished= "UPDATE PACKAGE_QUEUE set state=?, end_date=?, error=? where package=? and action='tocsv'"
                        
                    
        }
    }
    
    
    maintainers {
        url="http://maint.mandriva.com/lookup.php"
        logfile = "/home/doc4/logs/Maintainers.log"
        file="maintainers.txt"
    }
    
        

}




